package ZuoYe17;

import java.util.Scanner;

public class Di1 {
    public static void main(String[] args) {
        int cont=0;
        int index=0;
        System.out.println("请输第一个字符串");
        Scanner sc=new Scanner(System.in);
        String a= sc.nextLine();
        System.out.println("请输入第二个字符串");
        String b= sc.nextLine();
        while ((index=b.indexOf(a,index))!=-1){
            index=index+a.length();
            cont++;
        }
        System.out.println(a+"在"+b+"中出现了"+cont+"次");


    }
}
